﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for KeygenTest and is intended
    ///to contain all KeygenTest Unit Tests
    ///</summary>
    [TestClass()]
    public class KeygenTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Keygen Constructor
        ///</summary>
        [TestMethod()]
        public void KeygenConstructorTest() {
            Keygen target = new Keygen();
            Assert.AreEqual("<keygen/>", target.ToString());
        }

        /// <summary>
        ///A test for AutoFocus
        ///</summary>
        [TestMethod()]
        public void AutoFocusTest() {
            Keygen target = new Keygen();
            bool expected = false;
            bool actual;
            target.AutoFocus = expected;
            actual = target.AutoFocus;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Challenge
        ///</summary>
        [TestMethod()]
        public void ChallengeTest() {
            Keygen target = new Keygen();
            string expected = string.Empty;
            string actual;
            target.Challenge = expected;
            actual = target.Challenge;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Disabled
        ///</summary>
        [TestMethod()]
        public void DisabledTest() {
            Keygen target = new Keygen();
            bool expected = false;
            bool actual;
            target.Disabled = expected;
            actual = target.Disabled;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            Keygen target = new Keygen();
            Form expected = null;
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for KeyType
        ///</summary>
        [TestMethod()]
        public void KeyTypeTest() {
            Keygen target = new Keygen();
            Nullable<Keygen.KeyTypeChoices> expected = new Nullable<Keygen.KeyTypeChoices>();
            Nullable<Keygen.KeyTypeChoices> actual;
            target.KeyType = expected;
            actual = target.KeyType;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Keygen target = new Keygen();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Keygen k = new Keygen();
            k.AutoFocus = true;
            k.Challenge = "challenge";
            k.Disabled = true;
            Form f = new Form();
            f.ID = "formid";
            k.Form = f;
            k.KeyType = Keygen.KeyTypeChoices.Dsa;
            k.Name = "name";
            Assert.AreEqual("<keygen autofocus=\"autofocus\" " +
                "challenge=\"challenge\" " +
                "disabled=\"disabled\" " +
                "form=\"formid\" " +
                "keytype=\"dsa\" " +
                "name=\"name\"/>", k.ToString());
        }
    }
}
